<?php
include "../proses/konek.php";
session_start();
if(!isset($_SESSION['username']))
   {   
   ?><script language="javascript">alert('anda blm login');
document.location='../'</script><?php
 }
else
{
$username = $_SESSION['username'];
$status = $_SESSION['status'];
}
$simpan2=mysql_query("SELECT * FROM  $status where email = '$username'");
$hasil2=mysql_fetch_array($simpan2);
?>
<html>
<head>
    <meta content="IE=edge" http-equiv="X-UA-Compatible"></meta>

	<meta content="width=device-width, initial-scale=1" name="viewport"></meta>

	<meta content="" name="description"></meta>

	<meta content="" name="author"></meta>
    <link rel="stylesheet" type="text/css" href="../css/sidebar.css">
	
	<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700" />
	<script type="text/javascript" src="../css/tinymce/tinymce.min.js"></script>
	<!-- The main CSS file -->
	<link rel="stylesheet" href="../css/bootstrap/css/profile.css" >
    <link rel="stylesheet" href="../css/bootstrap/css/bootstrap.css" >
	<link rel="stylesheet" href="../css/bootstrap/css/bootstrap.min.css" >
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
	<link rel="stylesheet" href="../css/bootstrap/css/bootstrap-theme.min.css">
	
<?php	
	require_once('../render.php');
	$render=new render;
	$render->icon();
	$render->navigasi();
	$render->profile($status, $username);
	
?>
	<title></title>
</head>
<body>

<div id="wrapper">
	<div id="sidebar-wrapper">
		<?php
		include ('menuslide.php');
		$menu=new menu;
		$menu->init($username, $status);
		?>
	</div>
	<div id="page-content-wrapper">
		<div class="container-fluid">
			<div class="row" style="margin-top:80px">
				<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" id="subcontent">
					<?php
					if(!isset($_GET['id']))
					{
						echo '<script>alert("Data tidak tersedia")</script>';
					}
					else
					{
						$id=$_GET['id'];
					}
					$sql=mysql_query("SELECT * FROM posting where idpost='$id'");
					$cek=mysql_fetch_array($sql);
					echo '<div class="row">    
				            <br>
				            <div class="col-md-2 col-sm-3 text-center">
				              <a class="story-img" href="viewprofile.php?e='.$cek["author"].'"><img src="';
				             
				              	$img=mysql_query("SELECT img FROM guru where email= '$cek[author]' ");
								$rsimg= mysql_fetch_array($img);

				              echo $rsimg['img'];
				              echo ' " style="width:100px;height:100px" class="img-circle"></a>
				            </div>
				            <div class="col-md-10 col-sm-9">
				              <h3>';
					print $cek['judul'];
					echo '</h3>
              <div class="row">
                <div class="col-xs-9">
                  <p>';
					print $cek['isi'];
					echo '</div>
					</div>';
					?>
				</div>
			</div>
				
		</div>
			 
	</div>
		
</div>

		
<!-- JQuery Core -->


<script src="../js/search.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
		
<script type="text/javascript" src="../css/bootstrap/js/bootstrap.js"></script>
<!-- Custom Sidebar Javascript--> 
<script type="text/javascript" src="../js/metisMenu.min.js"></script>
<script src="../js/sb-admin-2.js"></script>
<script type="text/javascript" src="../js/sidebar.js"></script>
<!-- Custom Javascript Load Page-->		
<div>
	
		
<?php
	$render->footer();
?>
</div>
</body>
</html>

	
